package com.lipy.springootrabbitmq.config.deadLetter;

import com.lipy.springootrabbitmq.config.DLXRabbitMQConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DeadLetterSender {

    @Autowired
    RabbitTemplate rabbitTemplate;

    public void send(){
        System.out.println("DeadLetterSender.send");
        rabbitTemplate.convertAndSend(DLXRabbitMQConfig.DEAD_LETTER_EXCHANGE,DLXRabbitMQConfig.DEAD_LETTER_ROUTE,"deadmsg");
    }
}
